﻿package com.bizmlib.ui.composite
{
	import flash.events.*;
	import flash.display.DisplayObject;
	
	
	public class UICompositionEvent extends UICompositeItemEvent
	{
		public static const SHOW_COMPLETE:String = "showComplete";
		public static const SHOW_START:String = "showStart";
		public static const HIDE_COMPLETE:String = "hideComplete";
		public static const HIDE_START:String = "hideStart";
		public static const ITEM_SELECT:String = "itemSelect";
		public static const ITEM_ADDED:String = "itemAdded";
		public static const ITEMS_REARRANGE:String = "itemsRearrange";
		public static const ITEM_SHOW_COMPLETE:String = "itemShowComplete";
		public static const ITEM_HIDE_COMPLETE:String = "itemShowComplete";
		
		private var __dataProvider:Object;
		private var __item:DisplayObject;
		private var __itemIndex:Number;
		
		
		public function UICompositionEvent(type:String, dataProvider:Object = undefined, item:DisplayObject = undefined, itemIndex:Number = 0, bubbles:Boolean = true, cancelable:Boolean = true)
		{
			//super(type, bubbles, cancelable);
			super(type);
			
			__dataProvider = dataProvider;
			__item = item;
			__itemIndex = itemIndex;
		}
		
		
		public function get dataProvider():Object
		{
			return __dataProvider;
		}
		public function get item():DisplayObject
		{
			return __item;
		}
		public function get itemIndex():Number
		{
			return __itemIndex;
		}
		
		
		override public function toString():String
		{
			//return "[UICompositionEvent	type=" + type + "	item=" + item + "	itemIndex=" + itemIndex + "	dataProvider=" + dataProvider + "]";
			return formatToString("UICompositionEvent", "type", "target", "item", "itemIndex", "dataProvider", "bubbles", "cancelable");
		}
	}
}